package com.zhanqiao.service;

import com.zhanqiao.Dao.SelectOnSaleProductDao;
import com.zhanqiao.domain.ArticleBean;
import com.zhanqiao.domain.ProductBean;

import java.sql.SQLException;
import java.util.List;

public class SelectOnSaleProductService implements ArticleService {
    SelectOnSaleProductDao selectOnSaleProductDao = new SelectOnSaleProductDao();
    @Override
    public List<ArticleBean> articleService() {
        return null;
    }

    public List<ProductBean> articleService(String page, String limit) {

        List<ProductBean> list = selectOnSaleProductDao.selectAll(page, limit);
        return list;
    }
    public Long getProductCount() throws SQLException {
        return selectOnSaleProductDao.findCount();
    }

    public int editProduct(Integer pid, String pname, Integer psaleprice, Integer pcount) throws SQLException {
        return selectOnSaleProductDao.updateProduct(pid, pname, psaleprice, pcount);
    }
}
